]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier: Apply scale factor to crosshair length
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 6 Feb 2020 09:31:17 +0000 (10:31 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 7 Feb 2020 17:18:25 +0000 (18:18 +0100)
On hidpi displays the length is double as advertised, make it match
the advertised length.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/984

js/ui/magnifier.js

index d7d3506a57cbcb8cb250c03abfd55c8a418dcccc..af6c2567d665fd31f87e5ec790404afe7196f9ec 100644 (file)
@@ -430,8 +430,10 @@ var Magnifier = class Magnifier {
      *     lines making up the crosshairs.
      */
     setCrosshairsLength(length) {
-        if (this._crossHairs)
-            this._crossHairs.setLength(length);
+        if (this._crossHairs) {
+            let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
+            this._crossHairs.setLength(length / scaleFactor);
+        }
     }
 
     /**